package me.zhengjie.minbearwcs.utils;

import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.ss.usermodel.WorkbookFactory;

import java.io.IOException;
import java.io.InputStream;

public class ExcelReadUtil {
    public static Workbook getWorkbook(InputStream inputStream) throws IOException {
        //用自带的方法新建工作薄
        Workbook workbook = WorkbookFactory.create(inputStream);
        //后缀判断有版本转换问题
        //Workbook workbook = null;
        //if (fileType.equalsIgnoreCase(XLS)) {
        //    workbook = new HSSFWorkbook(inputStream);
        //} else if (fileType.equalsIgnoreCase(XLSX)) {
        //    workbook = new XSSFWorkbook(inputStream);
        //}
        return workbook;
    }
}
